<template>
	<view class="wy-page">
		 <web-view :webview-styles="webviewStyles" :src="weburl" @message="getMessage"></web-view> 
	</view>
</template>
<script>
	var that;
	var wy;//=uni.wy;	  
	var pubfn;//=wy.pubfn;
	 
	export default {
		data() {
			return {
				pageData:{
					 
				},
				weburl:'https://support.qq.com/product/511674',
				lastPage:'',
				webviewStyles: {
				    progress: {
				        color: '#4855d2'
				    }
				}, 
			}
		},
		onLoad(options = {}) { 
            wy=uni.wy;  
             pubfn=wy.pubfn;
             that=this
			let {url,title}=options
            if(title){
                uni.setNavigationBarTitle({
                    title
                })
            }
			if(url)
			{
				this.weburl=decodeURIComponent(url)
			}
			that.init();
		},
		
		methods: {
			init(){
				//记住上一个页面
				
			},
			getMessage(event){
				
			}
		},
		onBackPress(options)
		{
			if (options.from === 'backbutton') { 
				//#ifndef H5
				let pages = getCurrentPages()  
				let page = pages[pages.length - 1];  
				let currentPages = page.$getAppWebview()  
				let children=currentPages.children()  
				if(children.length<=1){
					//children[0].close()  
				}else{
					
				}
				//#endif
				return false 
		    }
			else if(options.from === 'navigateBack') { 
				   return false; 
			} 
		},
		onNavigationBarButtonTap(e) {
			console.log(e)
			 
			//this.$refs.wyShare.Open()
		} 
	}
</script>

<style lang="scss" scoped>

 
</style>
